package com.example.yiwei.crm.view.activity.coordinationActivity;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import com.example.yiwei.crm.R;
import com.example.yiwei.crm.data.GetAppointment;
import com.example.yiwei.crm.entity.ApointmentEntity;

public class DetailedManyiduActivity extends AppCompatActivity {
private TextView txt_code,txt_name,txt_age,txt_gender,txt_phone,txt_hospital,txt_department,txt_state,
    txt_appointment_time,ttx_manyidu;
   ApointmentEntity apointmentEntity;
    ImageView img_back;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_detailed_manyidu);
        txt_age= (TextView) findViewById(R.id.customer_manager_txt_ages);
        txt_name= (TextView) findViewById(R.id.customer_manager_txt_name);
        txt_code= (TextView) findViewById(R.id.customer_manager_code);
        txt_gender= (TextView) findViewById(R.id.customer_manager_txt_gender);
        txt_phone= (TextView) findViewById(R.id.customer_manager_txt_phone);
        txt_hospital= (TextView) findViewById(R.id.customer_manager_txt_hospital);
        txt_department= (TextView) findViewById(R.id.customer_manager_txt_department);
        txt_state= (TextView) findViewById(R.id.txt_hospital_txt_state);
        txt_appointment_time= (TextView) findViewById(R.id.txt_hospital_txt_appointment_time);
        ttx_manyidu= (TextView) findViewById(R.id.txt_hospital_txt_manyidu);
        img_back= (ImageView) findViewById(R.id.customer_manager_img_back);
        img_back.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                finish();
            }
        });
        apointmentEntity= GetAppointment.get();
        txt_phone.setText(apointmentEntity.getContact_phone_number());
        txt_age.setText(apointmentEntity.getCustomer_age()+"");
        txt_name.setText(apointmentEntity.getCustomer_name());
        txt_code.setText(apointmentEntity.getAppointment_number());
        txt_appointment_time.setText(apointmentEntity.getAppoint_date());
        if (apointmentEntity.getCustomer_gender()==1){
            txt_gender.setText("男");
        }else if (apointmentEntity.getCustomer_gender()==2){
            txt_gender.setText("女");
        }
        txt_department.setText(apointmentEntity.getAppint_department());
        txt_hospital.setText(apointmentEntity.getAppoint_hospital());
        if (apointmentEntity.getAppointment_state()==0){
            txt_state.setText("预约");
        }else if (apointmentEntity.getAppointment_state()==1){
            txt_state.setText("初诊");
        }else if (apointmentEntity.getAppointment_state()==2){
            txt_state.setText("复诊");
        }
        ttx_manyidu.setText(apointmentEntity.getMyd());
    }
}
